home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 19 / 8 / DISK1982.ZIP / PRTDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1991-03-15  |  3KB  |  124 lines

  1. {--------------------------------------------------------------------}
  2. {- Before compiling this demo program make sure the Unit Directories-}
  3. {- in the Options, Directories menu specify where to find the       -}
  4. {- FlashPac Units.                                                  -}
  5. {-                                                                  -}
  6. {- Compiler       Directory                                         -}
  7. {- --------       -----------------                                 -}
  8. {-  TP4           A:\TP4                                            -}
  9. {-  TP5           A:\TP5                                            -}
  10. {-  TP55          A:\TP55                                           -}
  11. {-                                                                  -}
  12. {--------------------------------------------------------------------}
  13.  
  14. program testit;
  15. uses Crt,FPPrt,FPVideo;
  16.  
  17. Type
  18.    Str8 = String[8];
  19. Var
  20.    Done : Boolean;
  21.  
  22.  
  23. Function DecToBin(Num : Integer) : Str8;
  24. Var
  25.    i,j : Integer;
  26.    St  : Str8;
  27. Begin
  28.    For i := 8 DownTo 1 Do Begin
  29.       St[i] := Chr( (Num Mod 2) + 48);
  30.       Num := Num Div 2;
  31.    End;
  32.    St[0] := Chr(8);
  33.    DecToBin := St;
  34. End;
  35.  
  36.  
  37. Procedure TestBiosPrtChar;
  38. Var
  39.    i,j,k : Integer;
  40.    Ch    : Char;
  41. Begin
  42.    For j := 1 To 10 Do Begin
  43.       For i := 1 To 26 Do Begin
  44.          k := BiosPrtChar(Chr(i+64),0);
  45.          If (k And $10) <> 0 Then
  46.             Writeln('Printer not selected...  Status = ',DecToBin(k) );
  47.       End;
  48.       k := BiosPrtChar(Chr(10),0);
  49.       If (k And $10) <> 0 Then
  50.          Writeln('Printer not selected...  Status = ',DecToBin(k) );
  51.       k := BiosPrtChar(Chr(13),0);
  52.       If (k And $10) <> 0 Then
  53.          Writeln('Printer not selected...  Status = ',DecToBin(k) );
  54.    End;
  55. End;
  56.  
  57. Procedure TestBiosPrtInit;
  58. Var
  59.    k : Integer;
  60. Begin
  61.    k := BiosPrtInit(0);
  62. End;
  63.  
  64. Procedure TestBiosPrtStat;
  65. Var
  66.    i : Integer;
  67. Begin
  68.    For i := 1 To 500 Do
  69.       Writeln('Printer Status = ',DecToBin(BiosPrtStat(0)) );
  70. End;
  71.  
  72. Procedure TestDosPrtChar;
  73. Var
  74.    i,j : Integer;
  75.    Ch  : Char;
  76. Begin
  77.    For j := 1 To 10 Do Begin
  78.       For i := 1 To 26 Do
  79.          DosPrtChar(Chr(i+64));
  80.       DosPrtChar(Chr(10));
  81.       DosPrtChar(Chr(13));
  82.    End;
  83. End;
  84.  
  85. Function GetMenuSelection : Integer;
  86. Var
  87.    Item : integer;
  88. Begin
  89.    Item := 0;
  90.    TextAttr := 7;
  91.    Repeat
  92.       ClrWin(1,1,80,25,7);
  93.       Window(1,1,80,25);
  94.       GotoxyAbs(1,1);
  95.       WriteStLn(' ');
  96.       WriteStln(' 1. BiosPrtChar     ');
  97.       WriteStln(' 2. BiosPrtInit     ');
  98.       WriteStln(' 3. BiosPrtStat     ');
  99.       WriteStln(' 4. DosPrtChar      ');
  100.       WriteStln(' ');
  101.       WriteStln(' 5. Quit');
  102.       WriteStln(' ');
  103.       WriteSt('Enter selection to test ==> ');
  104.       Readln(Item);
  105.    Until Item In [1..5];
  106.    GetMenuSelection := Item;
  107. End;
  108.  
  109. begin
  110.    DirectVideo := True;
  111.    ClrWin(1,1,80,25,7);
  112.    GotoxyAbs(1,1);
  113.    Done := False;
  114.    While Not Done Do Begin
  115.       Case GetMenuSelection Of
  116.           1 : TestBiosPrtChar;
  117.           2 : TestBiosPrtInit;
  118.           3 : TestBiosPrtStat;
  119.           4 : TestDosPrtChar;
  120.           5 : Done := True;
  121.       End;
  122.    End;
  123. End.
  124.